<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /*（4）圣杯布局，利用浮动和负边距来实现。父级元素设置左右的 padding，三列均设置向左浮动，中间一列放在最前面，宽度设置为父级元素的宽度，因此后面两列都被挤到了下一行，通过设置 margin负值将其移动到上一行，再利用相对定位，定位到两边。*/
    .outer {
      height: 100px;
      background-color: pink;
      padding: 0 200px 0 100px;
    }

    .left {
      position: relative;
      left: -100px;
      float: left;
      width: 100px;
      height: 100px;
      margin-left: -100%;
      background-color: tomato;
    }

    .right {
      position: relative;
      left: 200px;
      float: left;
      width: 200px;
      height: 100px;
      margin-left: -200px;
      background-color: gold;
    }

    .middle {
      float: left;
      width: 100%;
      height: 100px;
      background-color: lightgreen;
    }
  </style>
</head>

<body>
  <div class="outer ">
    <div class="middle">middle</div>
    <div class="left">left</div>
    <div class="right">right</div>
  </div>
</body>

</html>